package com.nttuan.view;

import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.MotionEvent;

public class CustomViewPaper extends ViewPager{
	private Boolean isEnable = true;
	public CustomViewPaper(Context context,AttributeSet attrs) {
		super(context,attrs);
	}
	public void enable(Boolean enable)
	{
		this.isEnable = enable;
	}
	@Override
	public boolean onInterceptTouchEvent(MotionEvent arg0) {
		if(isEnable)
			return super.onInterceptTouchEvent(arg0);
		return false;
	}
	@Override
	public boolean onTouchEvent(MotionEvent arg0) {
		
		if(isEnable)
			return super.onTouchEvent(arg0);
		return false;
	}

}
